PER.rover
Class StatsLog

java.lang.Object
  extended byPER.rover.StatsLog

public class StatsLog
extends java.lang.Object

Allows for the logging of program events in a format easily read into Microsoft Excel or other statistics software.


Field Summary
static int ANALYZE_ROCK
           
static int APPROACH_ROCK
           
static int BAD_INPUT_ERROR
           
static int BATTERY_LOW_ERROR
           
static int CAMERA_TIMEOUT_ERROR
           
static int CANT_START_ERROR
           
static int CEREB_TIMEOUT_ERROR
           
static int COMM_DEAD_ERROR
           
static int DRIVE
           
static int ERROR_FATAL
           
static int ERROR_FIXED
           
static int ERROR_SUCCESS
           
static int FIND_ROCK
           
static int HIT_WALL_ERROR
           
static int HL_CONTINUE_ERROR
           
static int INIT_LOG
           
static int INVALID_PACKET_LENGTH_ERROR
           
static int KILLED_ERROR
           
static int MIS_TIMEOUT
           
static int OBSTACLE_DETECTED_ERROR
           
static int PANORAMA
           
static int POV_TIMEOUT
           
static int PROGRAM_CLOSED
           
static int QUIT_BUTTON
           
static int SCAN
           
static int SEND_EMAIL
           
static int SMTP_FAILED_ERROR
           
static int START_ATTRACT
           
static int START_MISSION_CENTRAL
           
static int START_POV
           
static int START_RECEIVING_PANORAMA
           
static int STAYTON_INVALID_LENGTH_ERROR
           
static int STAYTON_IO_ERROR
           
static int STAYTON_UNKNOWN_TYPE_ERROR
           
static int STOP_ATTRACT
           
static int STOP_MISSION_CENTRAL
           
static int STOP_POV
           
static int STOP_RECEIVING_PANORAMA
           
static int TRY_AGAIN_BUTTON
           
static int TURN
           
static int TURN_HEAD
           
static int UNKNOWN_ERROR
           
static int UNKNOWN_PACKET_TYPE_ERROR
           
static int WRONG_STAYTON_VERSION_ERROR
           
 
Constructor Summary
StatsLog()
          Creates a new instance of StatsLog
 
Method Summary
static void initLogFile(java.lang.String name)
          Initializes the log file and prints the column headers to the file.
static void print(int event)
          Print a string to the logfile with a timestamp for the given event.
static void print(int event, boolean printToConsole)
          Print a string to the logfile with a timestamp for the given event.
static void print(int event, int value)
          Print a string to the logfile with a timestamp for the given event and print the data value.
static void print(int event, int value, boolean printToConsole)
          Print a string to the logfile with a timestamp for the given event and print the data value.
static void println(int event)
          Prints a line to the logfile with a timestamp for the given event.
static void println(int event, boolean printToConsole)
          Print a line to the logfile with a timestamp for the given event.
static void println(int event, int value)
          Prints a line to the logfile with a timestamp for the given event and prints the data value.
static void println(int event, int value, boolean printToConsole)
          Print a line to the logfile with a timestamp for the given event and print the data value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_LOG

public static final int INIT_LOG
See Also:
Constant Field Values

START_ATTRACT

public static final int START_ATTRACT
See Also:
Constant Field Values

STOP_ATTRACT

public static final int STOP_ATTRACT
See Also:
Constant Field Values

START_RECEIVING_PANORAMA

public static final int START_RECEIVING_PANORAMA
See Also:
Constant Field Values

STOP_RECEIVING_PANORAMA

public static final int STOP_RECEIVING_PANORAMA
See Also:
Constant Field Values

START_MISSION_CENTRAL

public static final int START_MISSION_CENTRAL
See Also:
Constant Field Values

STOP_MISSION_CENTRAL

public static final int STOP_MISSION_CENTRAL
See Also:
Constant Field Values

START_POV

public static final int START_POV
See Also:
Constant Field Values

STOP_POV

public static final int STOP_POV
See Also:
Constant Field Values

TRY_AGAIN_BUTTON

public static final int TRY_AGAIN_BUTTON
See Also:
Constant Field Values

QUIT_BUTTON

public static final int QUIT_BUTTON
See Also:
Constant Field Values

MIS_TIMEOUT

public static final int MIS_TIMEOUT
See Also:
Constant Field Values

POV_TIMEOUT

public static final int POV_TIMEOUT
See Also:
Constant Field Values

TURN

public static final int TURN
See Also:
Constant Field Values

DRIVE

public static final int DRIVE
See Also:
Constant Field Values

FIND_ROCK

public static final int FIND_ROCK
See Also:
Constant Field Values

APPROACH_ROCK

public static final int APPROACH_ROCK
See Also:
Constant Field Values

ANALYZE_ROCK

public static final int ANALYZE_ROCK
See Also:
Constant Field Values

SCAN

public static final int SCAN
See Also:
Constant Field Values

SEND_EMAIL

public static final int SEND_EMAIL
See Also:
Constant Field Values

PANORAMA

public static final int PANORAMA
See Also:
Constant Field Values

TURN_HEAD

public static final int TURN_HEAD
See Also:
Constant Field Values

OBSTACLE_DETECTED_ERROR

public static final int OBSTACLE_DETECTED_ERROR
See Also:
Constant Field Values

HIT_WALL_ERROR

public static final int HIT_WALL_ERROR
See Also:
Constant Field Values

CAMERA_TIMEOUT_ERROR

public static final int CAMERA_TIMEOUT_ERROR
See Also:
Constant Field Values

CEREB_TIMEOUT_ERROR

public static final int CEREB_TIMEOUT_ERROR
See Also:
Constant Field Values

STAYTON_IO_ERROR

public static final int STAYTON_IO_ERROR
See Also:
Constant Field Values

BATTERY_LOW_ERROR

public static final int BATTERY_LOW_ERROR
See Also:
Constant Field Values

COMM_DEAD_ERROR

public static final int COMM_DEAD_ERROR
See Also:
Constant Field Values

WRONG_STAYTON_VERSION_ERROR

public static final int WRONG_STAYTON_VERSION_ERROR
See Also:
Constant Field Values

KILLED_ERROR

public static final int KILLED_ERROR
See Also:
Constant Field Values

CANT_START_ERROR

public static final int CANT_START_ERROR
See Also:
Constant Field Values

UNKNOWN_PACKET_TYPE_ERROR

public static final int UNKNOWN_PACKET_TYPE_ERROR
See Also:
Constant Field Values

INVALID_PACKET_LENGTH_ERROR

public static final int INVALID_PACKET_LENGTH_ERROR
See Also:
Constant Field Values

SMTP_FAILED_ERROR

public static final int SMTP_FAILED_ERROR
See Also:
Constant Field Values

BAD_INPUT_ERROR

public static final int BAD_INPUT_ERROR
See Also:
Constant Field Values

STAYTON_INVALID_LENGTH_ERROR

public static final int STAYTON_INVALID_LENGTH_ERROR
See Also:
Constant Field Values

STAYTON_UNKNOWN_TYPE_ERROR

public static final int STAYTON_UNKNOWN_TYPE_ERROR
See Also:
Constant Field Values

HL_CONTINUE_ERROR

public static final int HL_CONTINUE_ERROR
See Also:
Constant Field Values

ERROR_SUCCESS

public static final int ERROR_SUCCESS
See Also:
Constant Field Values

UNKNOWN_ERROR

public static final int UNKNOWN_ERROR
See Also:
Constant Field Values

ERROR_FIXED

public static final int ERROR_FIXED
See Also:
Constant Field Values

ERROR_FATAL

public static final int ERROR_FATAL
See Also:
Constant Field Values

PROGRAM_CLOSED

public static final int PROGRAM_CLOSED
See Also:
Constant Field Values
Constructor Detail

StatsLog

public StatsLog()
Creates a new instance of StatsLog

Method Detail

initLogFile

public static void initLogFile(java.lang.String name)
Initializes the log file and prints the column headers to the file. If the log is not initalized, strings will be printed to System.out.


println

public static void println(int event)
Prints a line to the logfile with a timestamp for the given event.


println

public static void println(int event,
                           int value)
Prints a line to the logfile with a timestamp for the given event and prints the data value.


println

public static void println(int event,
                           boolean printToConsole)
Print a line to the logfile with a timestamp for the given event. If printToConsole is true, also print a timestamp and column header to System.out.


println

public static void println(int event,
                           int value,
                           boolean printToConsole)
Print a line to the logfile with a timestamp for the given event and print the data value. If printToConsole is true, also print a timestamp and column header to System.out.


print

public static void print(int event)
Print a string to the logfile with a timestamp for the given event.


print

public static void print(int event,
                         int value)
Print a string to the logfile with a timestamp for the given event and print the data value.


print

public static void print(int event,
                         boolean printToConsole)
Print a string to the logfile with a timestamp for the given event. If printToConsole is true, also print a timestamp and column header to System.out.


print

public static void print(int event,
                         int value,
                         boolean printToConsole)
Print a string to the logfile with a timestamp for the given event and print the data value. If printToConsole is true, also print a timestamp and column header to System.out.